﻿package Message.Game
{
    import Framework.MQ.*;
    import Framework.Serialize.*;
    import Message.Public.*;

    public class SChatMsg extends IMessageBase
    {
        public var fromPlayer:SMiniPlayer;
        public var isGm:Boolean;
        public var isGuide:Boolean;
        public var isSys:Boolean;
        public var force:int;
        public var toPlayer:String;
        public var toEntityId:SEntityId;
        public var chatType:int;
        public var content:String;
        public var font:Number;
        public var contentEx:String;
        public var items:Array;
        public var pets:Array;
        public var mounts:Array;
        public var chatDt:Date;
        public var jsStr:String;
        public const _type:int = 15051;
        public static var _regist:SChatMsg = new SChatMsg(true);

        public function SChatMsg(param1:Boolean = false)
        {
            if (param1)
            {
                MessageManager.instance().regist(this);
            }
            return;
        }// end function

        override public function getType() : int
        {
            return this._type;
        }// end function

        override public function clone() : IMessageBase
        {
            return new SChatMsg();
        }// end function

        override public function __write(param1:SerializeStream) : void
        {
            this.fromPlayer.__write(param1);
            param1.writeBool(this.isGm);
            param1.writeBool(this.isGuide);
            param1.writeBool(this.isSys);
            param1.writeByte(this.force);
            param1.writeString(this.toPlayer);
            this.toEntityId.__write(param1);
            param1.writeInt(this.chatType);
            param1.writeString(this.content);
            param1.writeLong(this.font);
            param1.writeString(this.contentEx);
            SeqPlayerItemHelper.write(param1, this.items);
            SeqPetHelper.write(param1, this.pets);
            SeqPublicMountHelper.write(param1, this.mounts);
            param1.writeDate(this.chatDt);
            param1.writeString(this.jsStr);
            return;
        }// end function

        override public function __read(param1:SerializeStream) : void
        {
            this.fromPlayer = new SMiniPlayer();
            this.fromPlayer.__read(param1);
            this.isGm = param1.readBool();
            this.isGuide = param1.readBool();
            this.isSys = param1.readBool();
            this.force = param1.readByte();
            this.toPlayer = param1.readString();
            this.toEntityId = new SEntityId();
            this.toEntityId.__read(param1);
            this.chatType = param1.readInt();
            this.content = param1.readString();
            this.font = param1.readLong();
            this.contentEx = param1.readString();
            this.items = SeqPlayerItemHelper.read(param1);
            this.pets = SeqPetHelper.read(param1);
            this.mounts = SeqPublicMountHelper.read(param1);
            this.chatDt = param1.readDate();
            this.jsStr = param1.readString();
            return;
        }// end function

    }
}
